
local meta = FindMetaTable( "Player" );

function meta:HasFlags( type, flags )

	if( flags == "" ) then return true; end

	local curflags;
	
	if( type == "" ) then
		curflags = self:GetPlayerFlags();
	else
		curflags = self:GetTable()[type .. "Flags"];
	end
	
	if( string.find( curflags, "+" ) ) then return true; end
	
	for n = 1, string.len( flags ) do
	
		local flag = string.sub( flags, n, n );
		
		if( not string.find( curflags, flag ) ) then
		
			return false;
		
		end
	
	end
	
	return true;

end

function meta:HasPlayerFlags( flags )

	return self:HasFlags( "", flags );

end

function meta:HasAdminFlags( flags )

	return self:HasFlags( "Admin", flags );

end